/*
 * nwpu/2011/2011_1.c
 *
 * Harry Wei <harryxiyou@gmail.com> (C) 2013
 */
#include <stdio.h>
#include <stdlib.h>

#define MAX		(22)

int fib(int n) {
	if (2 >= n) return 1;
	if (2 < n) return fib(n - 1) + fib(n - 2);

	return 0;
}

int main(int argc, char *argv[]) {
	int F[MAX] = {0,};
	int i = 0;
	int num = 0;
	int j = 0;
	int k = 0;
	int result = 0;
	int flag = 0;

	for (i = 1; i < MAX; i++) {
		/*pre 20th ones*/
		F[i] = fib(i);
		printf("Fib[%d]: %d\n", i, F[i]);
	}
	scanf("%d", &num);
	if (num > 10000) {
		fprintf(stderr, "%s\n", "Beyond scope!");
		return -1;
	}
	for (i = num; i > 0; i--) {
		/*TODO: print all components*/
		printf("%d = ", i);
		j = 21;
		result = i;
		while (j >= 1) {
			if (0 == result) {
				break;
			}
			if (result < F[j]) {
				j -= 1;
				continue;
			}
			if (result >= F[j]) {
				result -= F[j];
				if (0 == flag) {
				printf("%d", F[j]);
				flag = 1;
			} else {
				printf(" + %d", F[j]);
			}
			}
			j -= 1;
		}
#if 0
		for (k = j; k >= 1; k--) {
			if (0 == flag) {
				printf("%d", F[k]);
				flag = 1;
			} else {
				printf(" + %d", F[k]);
			}
		}
#endif
		printf("\n");
		flag = 0;
	}

	return 0;
}